/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jasoet.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Deny Prasetyo
 */
@Entity
@Table
public class SubKategori implements java.io.Serializable {
    private static final long serialVersionUID = 6951113194097762092L;

    @Id
    @Column(name = "kode", length = 15, nullable = false, unique = true)
    private String kode;
    @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
    @JoinColumn(name="kategori")
    private Kategori kategori;
    @Column(name = "keterangan", length = 50, nullable = false)
    private String keterangan;

    public SubKategori() {
    }

    public SubKategori(String kode, String keterangan) {
        this.kode = kode;
        this.keterangan = keterangan;
    }

    public String getKode() {
        return kode;
    }

    public void setKode(String kode) {
        this.kode = kode;
    }

    public Kategori getKategori() {
        return kategori;
    }

    public void setKategori(Kategori kategori) {
        this.kategori = kategori;
    }

    public String getKeterangan() {
        return keterangan;
    }

    public void setKeterangan(String keterangan) {
        this.keterangan = keterangan;
    }

}
